home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat3 / libelf / elf_begin.z / elf_begin
Encoding:
Text File  |  1998-10-30  |  28.2 KB  |  330 lines

  1.  
  2.  
  3.  
  4. EEEELLLLFFFF____BBBBEEEEGGGGIIIINNNN((((3333EEEE))))                                                    EEEELLLLFFFF____BBBBEEEEGGGGIIIINNNN((((3333EEEE))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      _eeee_llll_ffff______bbbb_eeee_gggg_iiii_nnnn - make a file descriptor
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      _cccc_cccc [_f_l_a_g ...] _f_i_l_e ...  _----_llll_eeee_llll_ffff [_l_i_b_r_a_r_y ...]
  13.  
  14.      _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_llll_iiii_bbbb_eeee_llll_ffff_...._hhhh_>>>>
  15.      _EEEE_llll_ffff _****_eeee_llll_ffff______bbbb_eeee_gggg_iiii_nnnn_((((_iiii_nnnn_tttt _ffff_iiii_llll_dddd_eeee_ssss_,,,, _EEEE_llll_ffff______CCCC_mmmm_dddd _cccc_mmmm_dddd_,,,, _EEEE_llll_ffff _****_rrrr_eeee_ffff_))))_;;;;
  16.  
  17. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  18.      _eeee_llll_ffff______bbbb_eeee_gggg_iiii_nnnn, _eeee_llll_ffff______nnnn_eeee_xxxx_tttt, _eeee_llll_ffff______rrrr_aaaa_nnnn_dddd, and _eeee_llll_ffff______eeee_nnnn_dddd work together to process ELF
  19.      object files, either individually or as members of archives.  After
  20.      obtaining an ELF descriptor from _eeee_llll_ffff______bbbb_eeee_gggg_iiii_nnnn, the program may read an
  21.      existing file, update an existing file, or create a new file.  _f_i_l_d_e_s is
  22.      an open file descriptor that _eeee_llll_ffff______bbbb_eeee_gggg_iiii_nnnn uses for reading or writing.  The
  23.      initial file offset [see _llll_ssss_eeee_eeee_kkkk(2)] is unconstrained, and the resulting
  24.      file offset is undefined.
  25.  
  26.      _c_m_d may have the following values.
  27.  
  28.      _EEEE_LLLL_FFFF______CCCC______NNNN_UUUU_LLLL_LLLL      When a program sets _c_m_d to this value, _eeee_llll_ffff______bbbb_eeee_gggg_iiii_nnnn returns
  29.                      a null pointer, without opening a new descriptor.  _r_e_f is
  30.                      ignored for this command.  See _eeee_llll_ffff______nnnn_eeee_xxxx_tttt(3E) and the
  31.                      examples below for more information.
  32.  
  33.      _EEEE_LLLL_FFFF______CCCC______RRRR_EEEE_AAAA_DDDD      When a program wishes to examine the contents of an
  34.                      existing file, it should set _c_m_d to this value.
  35.                      Depending on the value of _r_e_f, this command examines
  36.                      archive members or entire files.  Three cases can occur.
  37.  
  38.                      First, if _r_e_f is a null pointer, _eeee_llll_ffff______bbbb_eeee_gggg_iiii_nnnn allocates a
  39.                      new ELF descriptor and prepares to process the entire
  40.                      file.  If the file being read is an archive, _eeee_llll_ffff______bbbb_eeee_gggg_iiii_nnnn
  41.                      also prepares the resulting descriptor to examine the
  42.                      initial archive member on the next call to _eeee_llll_ffff______bbbb_eeee_gggg_iiii_nnnn, as
  43.                      if the program had used _eeee_llll_ffff______nnnn_eeee_xxxx_tttt or _eeee_llll_ffff______rrrr_aaaa_nnnn_dddd to ``move''
  44.                      to the initial member.
  45.  
  46.                      Second, if _r_e_f is a non-null descriptor associated with
  47.                      an archive file, _eeee_llll_ffff______bbbb_eeee_gggg_iiii_nnnn lets a program obtain a
  48.                      separate ELF descriptor associated with an individual
  49.                      member.  The program should have used _eeee_llll_ffff______nnnn_eeee_xxxx_tttt or
  50.                      _eeee_llll_ffff______rrrr_aaaa_nnnn_dddd to position _r_e_f appropriately (except for the
  51.                      initial member, which _eeee_llll_ffff______bbbb_eeee_gggg_iiii_nnnn prepares; see the example
  52.                      below).  In this case, _f_i_l_d_e_s should be the same file
  53.                      descriptor used for the parent archive.
  54.  
  55.                      Finally, if _r_e_f is a non-null ELF descriptor that is not
  56.                      an archive, _eeee_llll_ffff______bbbb_eeee_gggg_iiii_nnnn increments the number of
  57.                      activations for the descriptor and returns _r_e_f, without
  58.                      allocating a new descriptor and without changing the
  59.                      descriptor's read/write permissions.  To terminate the
  60.  
  61.  
  62.                                                                         PPPPaaaaggggeeee 1111
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69. EEEELLLLFFFF____BBBBEEEEGGGGIIIINNNN((((3333EEEE))))                                                    EEEELLLLFFFF____BBBBEEEEGGGGIIIINNNN((((3333EEEE))))
  70.  
  71.  
  72.  
  73.                      descriptor for _r_e_f, the program must call _eeee_llll_ffff______eeee_nnnn_dddd once
  74.                      for each activation.  See _eeee_llll_ffff______nnnn_eeee_xxxx_tttt(3E) and the examples
  75.                      below for more information.
  76.  
  77.      _EEEE_LLLL_FFFF______CCCC______RRRR_EEEE_AAAA_DDDD______MMMM_MMMM_AAAA_PPPP This command duplicates the actions of _EEEE_LLLL_FFFF______CCCC______RRRR_EEEE_AAAA_DDDD but
  78.                      uses the _mmmm_mmmm_aaaa_pppp() system call to access the file data in a
  79.                      more memory efficient manner.  If, after _l_i_b_e_l_f has
  80.                      opened the file, another process truncates the file
  81.                      _l_i_b_e_l_f could get a Segmentation Violation attempting to
  82.                      read data it believes is in the file (but which is no
  83.                      longer there due to the truncation).  Applications
  84.                      calling _l_i_b_e_l_f with _EEEE_LLLL_FFFF______CCCC______RRRR_EEEE_AAAA_DDDD______MMMM_MMMM_AAAA_PPPP may therefore wish to
  85.                      install a signal handler for _SSSS_IIII_GGGG_SSSS_EEEE_GGGG_VVVV (Segmentation
  86.                      Violation) and issue a message when it happens.
  87.  
  88.      _EEEE_LLLL_FFFF______CCCC______RRRR_DDDD_WWWW_RRRR      This command duplicates the actions of _EEEE_LLLL_FFFF______CCCC______RRRR_EEEE_AAAA_DDDD and
  89.                      additionally allows the program to update the file image
  90.                      [see _eeee_llll_ffff______uuuu_pppp_dddd_aaaa_tttt_eeee(3E)].  That is, using _EEEE_LLLL_FFFF______CCCC______RRRR_EEEE_AAAA_DDDD gives a
  91.                      read-only view of the file, while _EEEE_LLLL_FFFF______CCCC______RRRR_DDDD_WWWW_RRRR lets the
  92.                      program read _a_n_d write the file.  _EEEE_LLLL_FFFF______CCCC______RRRR_DDDD_WWWW_RRRR is not valid
  93.                      for archive members.  If _r_e_f is non-null, it must have
  94.                      been created with the _EEEE_LLLL_FFFF______CCCC______RRRR_DDDD_WWWW_RRRR command.
  95.  
  96.      _EEEE_LLLL_FFFF______CCCC______WWWW_RRRR_IIII_TTTT_EEEE     If the program wishes to ignore previous file contents,
  97.                      presumably to create a new file, it should set _c_m_d to
  98.                      this value.  _r_e_f is ignored for this command.
  99.  
  100.      _EEEE_LLLL_FFFF______CCCC______WWWW_RRRR_IIII_TTTT_EEEE______FFFF_AAAA_SSSS_TTTT
  101.                      is the same as _EEEE_LLLL_FFFF______CCCC______WWWW_RRRR_IIII_TTTT_EEEE except that instead of
  102.                      _m_a_l_l_o_c()ing memory for the output file (and then doing a
  103.                      _w_r_i_t_e(2) and _f_r_e_e()) _EEEE_LLLL_FFFF______CCCC______WWWW_RRRR_IIII_TTTT_EEEE______FFFF_AAAA_SSSS_TTTT writes the output
  104.                      directly to the file system (by doing _w_r_i_t_es as needed).
  105.                      Avoiding the _m_a_l_l_o_c() can help limit time-consuming
  106.                      paging activity.
  107.  
  108.      _eeee_llll_ffff______bbbb_eeee_gggg_iiii_nnnn ``works'' on all files (including files with zero bytes),
  109.      providing it can allocate memory for its internal structures and read any
  110.      necessary information from the file.  Programs reading object files thus
  111.      may call _eeee_llll_ffff______kkkk_iiii_nnnn_dddd or _eeee_llll_ffff______gggg_eeee_tttt_eeee_hhhh_dddd_rrrr to determine the file type (only object
  112.      files have an ELF header).  If the file is an archive with no more
  113.      members to process, or an error occurs, _eeee_llll_ffff______bbbb_eeee_gggg_iiii_nnnn returns a null pointer.
  114.      Otherwise, the return value is a non-null ELF descriptor.
  115.  
  116.      Before the first call to _eeee_llll_ffff______bbbb_eeee_gggg_iiii_nnnn, a program must call _eeee_llll_ffff______vvvv_eeee_rrrr_ssss_iiii_oooo_nnnn to
  117.      coordinate versions.
  118.  
  119. SSSSYYYYSSSSTTTTEEEEMMMM SSSSEEEERRRRVVVVIIIICCCCEEEESSSS
  120.      When processing a file, the library decides when to read or write the
  121.      file, depending on the program's requests.  Normally, the library assumes
  122.      the file descriptor remains usable for the life of the ELF descriptor.
  123.      If, however, a program must process many files simultaneously and the
  124.      underlying operating system limits the number of open files, the program
  125.  
  126.  
  127.  
  128.                                                                         PPPPaaaaggggeeee 2222
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135. EEEELLLLFFFF____BBBBEEEEGGGGIIIINNNN((((3333EEEE))))                                                    EEEELLLLFFFF____BBBBEEEEGGGGIIIINNNN((((3333EEEE))))
  136.  
  137.  
  138.  
  139.      can use _eeee_llll_ffff______cccc_nnnn_tttt_llll to let it reuse file descriptors.  After calling
  140.      _eeee_llll_ffff______cccc_nnnn_tttt_llll with appropriate arguments, the program may close the file
  141.      descriptor without interfering with the library.
  142.  
  143.      All data associated with an ELF descriptor remain allocated until _eeee_llll_ffff______eeee_nnnn_dddd
  144.      terminates the descriptor's last activation.  After the descriptors have
  145.      been terminated, the storage is released; attempting to reference such
  146.      data gives undefined behavior.  Consequently, a program that deals with
  147.      multiple input (or output) files must keep the ELF descriptors active
  148.      until it finishes with them.
  149.  
  150. EEEEXXXXAAAAMMMMPPPPLLLLEEEESSSS
  151.      A prototype for reading a file appears below.  If the file is a simple
  152.      object file, the program executes the loop one time, receiving a null
  153.      descriptor in the second iteration.  In this case, both _eeee_llll_ffff and _aaaa_rrrr_ffff will
  154.      have the same value, the activation count will be two, and the program
  155.      calls _eeee_llll_ffff______eeee_nnnn_dddd twice to terminate the descriptor.  If the file is an
  156.      archive, the loop processes each archive member in turn, ignoring those
  157.      that are not object files.
  158.  
  159.           _iiii_ffff _((((_eeee_llll_ffff______vvvv_eeee_rrrr_ssss_iiii_oooo_nnnn_((((_EEEE_VVVV______CCCC_UUUU_RRRR_RRRR_EEEE_NNNN_TTTT_)))) _====_==== _EEEE_VVVV______NNNN_OOOO_NNNN_EEEE_))))
  160.           _{{{{
  161.                   _////_**** _llll_iiii_bbbb_rrrr_aaaa_rrrr_yyyy _oooo_uuuu_tttt _oooo_ffff _dddd_aaaa_tttt_eeee _****_////
  162.                   _////_**** _rrrr_eeee_cccc_oooo_vvvv_eeee_rrrr _ffff_rrrr_oooo_mmmm _eeee_rrrr_rrrr_oooo_rrrr _****_////
  163.           _}}}}
  164.           _cccc_mmmm_dddd _==== _EEEE_LLLL_FFFF______CCCC______RRRR_EEEE_AAAA_DDDD_;;;;
  165.           _aaaa_rrrr_ffff _==== _eeee_llll_ffff______bbbb_eeee_gggg_iiii_nnnn_((((_ffff_iiii_llll_dddd_eeee_ssss_,,,, _cccc_mmmm_dddd_,,,, _((((_EEEE_llll_ffff _****_))))_0000_))))_;;;;
  166.           _wwww_hhhh_iiii_llll_eeee _((((_((((_eeee_llll_ffff _==== _eeee_llll_ffff______bbbb_eeee_gggg_iiii_nnnn_((((_ffff_iiii_llll_dddd_eeee_ssss_,,,, _cccc_mmmm_dddd_,,,, _aaaa_rrrr_ffff_))))_)))) _!!!!_==== _0000_))))
  167.           _{{{{
  168.                   _iiii_ffff _((((_((((_eeee_hhhh_dddd_rrrr _==== _eeee_llll_ffff_3333_2222______gggg_eeee_tttt_eeee_hhhh_dddd_rrrr_((((_eeee_llll_ffff_))))_)))) _!!!!_==== _0000_))))
  169.                   _{{{{
  170.                           _////_**** _pppp_rrrr_oooo_cccc_eeee_ssss_ssss _tttt_hhhh_eeee _ffff_iiii_llll_eeee _...._...._.... _****_////
  171.                   _}}}}
  172.                   _cccc_mmmm_dddd _==== _eeee_llll_ffff______nnnn_eeee_xxxx_tttt_((((_eeee_llll_ffff_))))_;;;;
  173.                   _eeee_llll_ffff______eeee_nnnn_dddd_((((_eeee_llll_ffff_))))_;;;;
  174.           _}}}}
  175.           _eeee_llll_ffff______eeee_nnnn_dddd_((((_aaaa_rrrr_ffff_))))_;;;;
  176.  
  177.      Alternatively, the next example illustrates random archive processing.
  178.      After identifying the file as an archive, the program repeatedly
  179.      processes archive members of interest.  For clarity, this example omits
  180.      error checking and ignores simple object files.  Additionally, this
  181.      fragment preserves the ELF descriptors for all archive members, because
  182.      it does not call _eeee_llll_ffff______eeee_nnnn_dddd to terminate them.
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.                                                                         PPPPaaaaggggeeee 3333
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201. EEEELLLLFFFF____BBBBEEEEGGGGIIIINNNN((((3333EEEE))))                                                    EEEELLLLFFFF____BBBBEEEEGGGGIIIINNNN((((3333EEEE))))
  202.  
  203.  
  204.  
  205.           _eeee_llll_ffff______vvvv_eeee_rrrr_ssss_iiii_oooo_nnnn_((((_EEEE_VVVV______CCCC_UUUU_RRRR_RRRR_EEEE_NNNN_TTTT_))))_;;;;
  206.           _aaaa_rrrr_ffff _==== _eeee_llll_ffff______bbbb_eeee_gggg_iiii_nnnn_((((_ffff_iiii_llll_dddd_eeee_ssss_,,,, _EEEE_LLLL_FFFF______CCCC______RRRR_EEEE_AAAA_DDDD_,,,, _((((_EEEE_llll_ffff _****_))))_0000_))))_;;;;
  207.           _iiii_ffff _((((_eeee_llll_ffff______kkkk_iiii_nnnn_dddd_((((_aaaa_rrrr_ffff_)))) _!!!!_==== _EEEE_LLLL_FFFF______KKKK______AAAA_RRRR_))))
  208.           _{{{{
  209.                   _////_**** _nnnn_oooo_tttt _aaaa_nnnn _aaaa_rrrr_cccc_hhhh_iiii_vvvv_eeee _****_////
  210.           _}}}}
  211.           _////_**** _iiii_nnnn_iiii_tttt_iiii_aaaa_llll _pppp_rrrr_oooo_cccc_eeee_ssss_ssss_iiii_nnnn_gggg _****_////
  212.           _////_**** _ssss_eeee_tttt _oooo_ffff_ffff_ssss_eeee_tttt _==== _...._...._.... _ffff_oooo_rrrr _dddd_eeee_ssss_iiii_rrrr_eeee_dddd _mmmm_eeee_mmmm_bbbb_eeee_rrrr _hhhh_eeee_aaaa_dddd_eeee_rrrr _****_////
  213.           _wwww_hhhh_iiii_llll_eeee _((((_eeee_llll_ffff______rrrr_aaaa_nnnn_dddd_((((_aaaa_rrrr_ffff_,,,, _oooo_ffff_ffff_ssss_eeee_tttt_)))) _====_==== _oooo_ffff_ffff_ssss_eeee_tttt_))))
  214.           _{{{{
  215.                   _iiii_ffff _((((_((((_eeee_llll_ffff _==== _eeee_llll_ffff______bbbb_eeee_gggg_iiii_nnnn_((((_ffff_iiii_llll_dddd_eeee_ssss_,,,, _EEEE_LLLL_FFFF______CCCC______RRRR_EEEE_AAAA_DDDD_,,,, _aaaa_rrrr_ffff_))))_)))) _====_==== _0000_))))
  216.                           _bbbb_rrrr_eeee_aaaa_kkkk_;;;;
  217.                   _iiii_ffff _((((_((((_eeee_hhhh_dddd_rrrr _==== _eeee_llll_ffff_3333_2222______gggg_eeee_tttt_eeee_hhhh_dddd_rrrr_((((_eeee_llll_ffff_))))_)))) _!!!!_==== _0000_))))
  218.                   _{{{{
  219.                           _////_**** _pppp_rrrr_oooo_cccc_eeee_ssss_ssss _aaaa_rrrr_cccc_hhhh_iiii_vvvv_eeee _mmmm_eeee_mmmm_bbbb_eeee_rrrr _...._...._.... _****_////
  220.                   _}}}}
  221.                   _////_**** _ssss_eeee_tttt _oooo_ffff_ffff_ssss_eeee_tttt _==== _...._...._.... _ffff_oooo_rrrr _dddd_eeee_ssss_iiii_rrrr_eeee_dddd _mmmm_eeee_mmmm_bbbb_eeee_rrrr _hhhh_eeee_aaaa_dddd_eeee_rrrr _****_////
  222.           _}}}}
  223.  
  224.      The following outline shows how one might create a new ELF file.  This
  225.      example is simplified to show the overall flow.
  226.  
  227.           _eeee_llll_ffff______vvvv_eeee_rrrr_ssss_iiii_oooo_nnnn_((((_EEEE_VVVV______CCCC_UUUU_RRRR_RRRR_EEEE_NNNN_TTTT_))))_;;;;
  228.           _ffff_iiii_llll_dddd_eeee_ssss _==== _oooo_pppp_eeee_nnnn_((((_""""_pppp_aaaa_tttt_hhhh_////_nnnn_aaaa_mmmm_eeee_""""_,,,, _OOOO______RRRR_DDDD_WWWW_RRRR_||||_OOOO______TTTT_RRRR_UUUU_NNNN_CCCC_||||_OOOO______CCCC_RRRR_EEEE_AAAA_TTTT_,,,, _0000_6666_6666_6666_))))_;;;;
  229.           _iiii_ffff _((((_((((_eeee_llll_ffff _==== _eeee_llll_ffff______bbbb_eeee_gggg_iiii_nnnn_((((_ffff_iiii_llll_dddd_eeee_ssss_,,,, _EEEE_LLLL_FFFF______CCCC______WWWW_RRRR_IIII_TTTT_EEEE_,,,, _((((_EEEE_llll_ffff _****_))))_0000_))))_)))) _====_==== _0000_))))
  230.                   _rrrr_eeee_tttt_uuuu_rrrr_nnnn_;;;;
  231.           _eeee_hhhh_dddd_rrrr _==== _eeee_llll_ffff_3333_2222______nnnn_eeee_wwww_eeee_hhhh_dddd_rrrr_((((_eeee_llll_ffff_))))_;;;;
  232.           _pppp_hhhh_dddd_rrrr _==== _eeee_llll_ffff_3333_2222______nnnn_eeee_wwww_pppp_hhhh_dddd_rrrr_((((_eeee_llll_ffff_,,,, _cccc_oooo_uuuu_nnnn_tttt_))))_;;;;
  233.           _ssss_cccc_nnnn _==== _eeee_llll_ffff______nnnn_eeee_wwww_ssss_cccc_nnnn_((((_eeee_llll_ffff_))))_;;;;
  234.           _ssss_hhhh_dddd_rrrr _==== _eeee_llll_ffff_3333_2222______gggg_eeee_tttt_ssss_hhhh_dddd_rrrr_((((_ssss_cccc_nnnn_))))_;;;;
  235.           _dddd_aaaa_tttt_aaaa _==== _eeee_llll_ffff______nnnn_eeee_wwww_dddd_aaaa_tttt_aaaa_((((_ssss_cccc_nnnn_))))_;;;;
  236.           _eeee_llll_ffff______uuuu_pppp_dddd_aaaa_tttt_eeee_((((_eeee_llll_ffff_,,,, _EEEE_LLLL_FFFF______CCCC______WWWW_RRRR_IIII_TTTT_EEEE_))))_;;;;
  237.           _eeee_llll_ffff______eeee_nnnn_dddd_((((_eeee_llll_ffff_))))_;;;;
  238.  
  239.      Finally, the following outline shows how one might update an existing ELF
  240.      file.  Again, this example is simplified to show the overall flow.
  241.  
  242.           _eeee_llll_ffff______vvvv_eeee_rrrr_ssss_iiii_oooo_nnnn_((((_EEEE_VVVV______CCCC_UUUU_RRRR_RRRR_EEEE_NNNN_TTTT_))))_;;;;
  243.           _ffff_iiii_llll_dddd_eeee_ssss _==== _oooo_pppp_eeee_nnnn_((((_""""_pppp_aaaa_tttt_hhhh_////_nnnn_aaaa_mmmm_eeee_""""_,,,, _OOOO______RRRR_DDDD_WWWW_RRRR_))))_;;;;
  244.           _eeee_llll_ffff _==== _eeee_llll_ffff______bbbb_eeee_gggg_iiii_nnnn_((((_ffff_iiii_llll_dddd_eeee_ssss_,,,, _EEEE_LLLL_FFFF______CCCC______RRRR_DDDD_WWWW_RRRR_,,,, _((((_EEEE_llll_ffff _****_))))_0000_))))_;;;;
  245.  
  246.           _////_**** _aaaa_dddd_dddd _nnnn_eeee_wwww _oooo_rrrr _dddd_eeee_llll_eeee_tttt_eeee _oooo_llll_dddd _iiii_nnnn_ffff_oooo_rrrr_mmmm_aaaa_tttt_iiii_oooo_nnnn _...._...._.... _****_////
  247.  
  248.           _cccc_llll_oooo_ssss_eeee_((((_cccc_rrrr_eeee_aaaa_tttt_((((_""""_pppp_aaaa_tttt_hhhh_////_nnnn_aaaa_mmmm_eeee_""""_,,,, _0000_6666_6666_6666_))))_))))_;;;;
  249.           _eeee_llll_ffff______uuuu_pppp_dddd_aaaa_tttt_eeee_((((_eeee_llll_ffff_,,,, _EEEE_LLLL_FFFF______CCCC______WWWW_RRRR_IIII_TTTT_EEEE_))))_;;;;
  250.           _eeee_llll_ffff______eeee_nnnn_dddd_((((_eeee_llll_ffff_))))_;;;;
  251.  
  252.      In the example above, the call to _cccc_rrrr_eeee_aaaa_tttt truncates the file, thus ensuring
  253.      the resulting file will have the ``right'' size.  Without truncation, the
  254.      updated file might be as big as the original, even if information were
  255.      deleted.  The library truncates the file, if it can, with _ffff_tttt_rrrr_uuuu_nnnn_cccc_aaaa_tttt_eeee [see
  256.      _tttt_rrrr_uuuu_nnnn_cccc_aaaa_tttt_eeee(2)].  Some systems, however, do not support _ffff_tttt_rrrr_uuuu_nnnn_cccc_aaaa_tttt_eeee, and the
  257.  
  258.  
  259.  
  260.                                                                         PPPPaaaaggggeeee 4444
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267. EEEELLLLFFFF____BBBBEEEEGGGGIIIINNNN((((3333EEEE))))                                                    EEEELLLLFFFF____BBBBEEEEGGGGIIIINNNN((((3333EEEE))))
  268.  
  269.  
  270.  
  271.      call to _cccc_rrrr_eeee_aaaa_tttt protects against this.
  272.  
  273.      Notice that both file creation examples open the file with write _a_n_d read
  274.      permissions.  The library is not compiled to use _mmmm_mmmm_aaaa_pppp so there is no need
  275.      for write permission. But for maximum portability with implementations
  276.      that do use _mmmm_mmmm_aaaa_pppp for file creation you may wish to provide both write _a_n_d
  277.      read permissions.
  278.  
  279. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  280.      _cccc_rrrr_eeee_aaaa_tttt(2), _llll_ssss_eeee_eeee_kkkk(2), _mmmm_mmmm_aaaa_pppp(2), _oooo_pppp_eeee_nnnn(2), _tttt_rrrr_uuuu_nnnn_cccc_aaaa_tttt_eeee(2), _eeee_llll_ffff(3E), _eeee_llll_ffff______cccc_nnnn_tttt_llll(3E),
  281.      _eeee_llll_ffff______eeee_nnnn_dddd(3E), _eeee_llll_ffff______gggg_eeee_tttt_aaaa_rrrr_hhhh_dddd_rrrr(3E), _eeee_llll_ffff______gggg_eeee_tttt_bbbb_aaaa_ssss_eeee(3E), _eeee_llll_ffff______gggg_eeee_tttt_dddd_aaaa_tttt_aaaa(3E),
  282.      _eeee_llll_ffff______gggg_eeee_tttt_eeee_hhhh_dddd_rrrr(3E), _eeee_llll_ffff______gggg_eeee_tttt_pppp_hhhh_dddd_rrrr(3E), _eeee_llll_ffff______gggg_eeee_tttt_ssss_cccc_nnnn(3E), _eeee_llll_ffff______kkkk_iiii_nnnn_dddd(3E),
  283.      _eeee_llll_ffff______nnnn_eeee_xxxx_tttt(3E), _eeee_llll_ffff______rrrr_aaaa_nnnn_dddd(3E), _eeee_llll_ffff______rrrr_aaaa_wwww_ffff_iiii_llll_eeee(3E), _eeee_llll_ffff______uuuu_pppp_dddd_aaaa_tttt_eeee(3E),
  284.      _eeee_llll_ffff______vvvv_eeee_rrrr_ssss_iiii_oooo_nnnn(3E), _aaaa_rrrr(4).
  285.  
  286. NNNNOOOOTTTTEEEESSSS
  287.      COFF is an object file format that preceded ELF .  COFF object files
  288.      cannot be used with this library.
  289.  
  290.      _EEEE_LLLL_FFFF______CCCC______RRRR_EEEE_AAAA_DDDD______MMMM_MMMM_AAAA_PPPP and _EEEE_LLLL_FFFF______CCCC______WWWW_RRRR_IIII_TTTT_EEEE______FFFF_AAAA_SSSS_TTTT are options specific to this
  291.      implementation, not options which are generally available.
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.                                                                         PPPPaaaaggggeeee 5555
  327.  
  328.  
  329.  
  330.